﻿using SBlogCore.Common.FluentValidatorExtend;

namespace SBlogCore.WebAdminApplication.SysRoleManager.Dto
{
    public class SysRoleInfoUploadInPut: SysRoleInfoInPut
    {
        public long? Id { get; set; }
    }

    public class SysRoleInfoInPut
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string? Code { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }
    }
    /// <summary>
    /// 查询模型
    /// </summary>
    public class SysRoleInfoQueryInPut
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string? Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string? Code { get; set; }
        /// <summary>
        /// 页数
        /// </summary>
        public int? PageIndex { get; set; }
        /// <summary>
        /// 页面大小
        /// </summary>
        public int? PageSize { get; set; }
    }

    /// <summary>
    /// 验证
    /// </summary>
    public class SysRoleInfoInPutValidator : SblogCoreAbstractValidator<SysRoleInfoInPut>
    {
        public SysRoleInfoInPutValidator()
        {
            RuleFor(x => x.Name).NotNull().WithMessage("名称不能为空");
            RuleFor(x => x.Code).NotNull().WithMessage("编码不能为空");
        }
    }
    /// <summary>
    /// 验证
    /// </summary>
    public class SysRoleInfoUploadInPutValidator : SblogCoreAbstractValidator<SysRoleInfoUploadInPut>
    {
        public SysRoleInfoUploadInPutValidator()
        {
            RuleFor(x => x.Id).NotNull().WithMessage("Id不能为空");
        }
    }
}
